package threaddemo16;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * Created by L.jp
 * Description:
 * User: 86189
 * Date: 2022-08-07
 * Time: 17:35
 */
/*
测试类(Demo)：里面有main方法，main方法中的代码步骤如下
创建阻塞队列对象
创建生产者线程和消费者线程对象,构造方法中传入阻塞队列对象
分别开启两个线程
*/
public class TestDemo {
    public static void main(String[] args) {
        ArrayBlockingQueue<String> aq=new ArrayBlockingQueue<String>(1);
        
        Cooker cooker=new Cooker(aq);
        cooker.start();
        
        Foodie foodie=new Foodie(aq);
        foodie.start();
    }
}
